function drawGrid( context, x1, y1, x2, y2, cx, cy) {
	cy = cy || cx;
	var bx, by, ex, ey;
	if ( x1 < x2) {
		bx = x1;
		ex = x2;
	}else {
		bx = x2;
		ex = x1;
	}
	if ( y1 < y2) {
		by = y1;
		ey = y2;
	} else {
		by = y2;
		ey = y1;
	}
	
	context.beginPath();
	for ( y = by; y <= ey; y += cy) {
		context.moveTo( bx, y);
		context.lineTo( ex, y);
	}
	for ( x = bx; x <= ex; x += cx) {
		context.moveTo( x, by);
		context.lineTo( x, ey);
	}
	context.stroke();
}